package org.arm.crse.qa.evolution.basis;

import org.arm.crse.qa.evolution.BodyMassIndex;
import org.junit.*;

import static org.junit.Assert.*;

public class BodyMassIndexTest0202 {

    private BodyMassIndex testObj;

    @BeforeClass
    public static void prepareEnvironment() {
        System.out.println("Run @BeforeClass method");
    }

    @AfterClass
    public static void RestoreEnvironment() {
        System.out.println("Run @AfterClass method");
    }

    //TODO: how to improve it
    @Before
    public void setUp() throws Exception {
        testObj = new BodyMassIndex();
        System.out.println("Run @Before method");
    }

    //TODO: how to improve it
    @After
    public void tearDown() throws Exception {
        testObj = null;
        System.out.println("Run @After method");
    }

    @Test
    public void testGetBMIType_Thin(){
        testObj.setValues(45.0,1.6);
        String expected = "偏瘦";
        assertEquals(expected,testObj.getBMILevel());
    }

    @Test
    public void testGetBMIType_Normal(){
        testObj.setValues(55.0,1.6);
        String expected = "正常";
        assertEquals(expected,testObj.getBMILevel());
    }

    @Test
    public void testGetBMIType_SlightlyFat() {
        testObj.setValues(68.0,1.6);
        String expected = "偏胖";
        assertEquals(expected,testObj.getBMILevel());
    }

    @Test
    public void testGetBMIType_Fat() {
        testObj.setValues(80.0, 1.6);
        String expected = "肥胖";
        assertEquals(expected,testObj.getBMILevel());
    }
}